var express = require('express');
var router = express.Router();

const db = require('../public/javascripts/db');

/* GET home page. */
router.get('/', function(req, res, next) {
    let sql = "select * from hotspot";
    let info = req.query;
    db(sql, info, (result)=>{
        if(result.length>=0){
            res.json({
                code:200,
                message:"查询成功",
                data:result
            })
        }else{
            res.json({
                code:500,
                message:"服务器错误"
            })
        }
    })
});

module.exports = router;